package com.zige.zige.pojo;


import android.util.Log;

import org.json.JSONObject;

import java.io.Serializable;

/**
 * Created by Fei on 2015/11/11.
 */
public class UserInfo implements JSONSupport, Serializable {
    //用户id
    public String userID;
    //手机号码
    public String phoneNumber;
    //用户密码
    public String userPassword;
    //安全锁密码
    public String safetyLockPassword;
    //设备唯一id
    public String deviceId;
    //推送key
    public String pushKey;
    //孩子名字
    public String childName;
    //孩子性别
    public String childSex;
    //孩子生日
    public String childBirthday;
    //家长姓名
    public String parentName;
    //家长身份
    public String parentIdentity;
    //地址
    public String address;

    //头像链接地址
    public String headPortraitUrl;

    public String  videoTags;

    public String locadHeadUrl;

    //app版本号
    public int appVersion;




    public String qqOpenId;
    public String wxOpenId;

    public String status;


    /**
     *
     */
    public String token;

    @Override
    public void parsefromJSON(String json) {
        Log.e("wu",json);
        try {
            JSONObject obj = new JSONObject(json);
            this.videoTags = obj.getString("tags");
            this.userID = obj.getString("id");
            this.phoneNumber = obj.getString("phone");
            this.userPassword = obj.getString("password");

            this.safetyLockPassword = obj.getString("parentPassword");
            this.deviceId = obj.getString("deviceId");
            this.pushKey = obj.getString("pushKey");

            this.childName = obj.getString("childName");
            this.childSex = obj.getString("childSex");
            this.childBirthday = obj.getString("childBirthday");

            this.parentName = obj.getString("parentName");
            this.parentIdentity = obj.getString("parentIdentity");
            this.address = obj.getString("address");

            this.qqOpenId = obj.getString("qqOpenid");
            this.wxOpenId = obj.getString("wxOpenid");

            this.status = obj.getString("status");
            this.headPortraitUrl = obj.getString("iconUrl");
            this.locadHeadUrl =obj.getString("iconUrl");


        } catch (Exception e) {
            e.printStackTrace();
        }
    }


    @Override
    public String toString() {
        return "UserInfo{" +
                "userID='" + userID + '\'' +
                ",token='" + token + '\'' +
                ", phoneNumber='" + phoneNumber + '\'' +
                ", userPassword='" + userPassword + '\'' +
                ", safetyLockPassword=" + safetyLockPassword +

                ", deviceId=" + deviceId +
                ", pushKey='" + pushKey + '\'' +

                ", childName='" + childName + '\'' +
                ", childSex=" + childSex +
                ", childBirthday='" + childBirthday + '\'' +

                ", parentName=" + parentName +
                ", parentIdentity='" + parentIdentity + '\'' +
                ", address='" + address + '\'' +

                ", headPortraitUrl='" + headPortraitUrl + '\'' +
                ", qqOpenId='" + qqOpenId + '\'' +
                ", address='" + wxOpenId + '\'' +
                ", wxOpenId='" + wxOpenId + '\'' +

                ", status='" + status + '\'' +

                '}';
    }
}
